package com.bmmtwabp.employeedashbord.util;

import java.util.*;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description: 获取微信请求接口凭证
 * @Param:
 * @return:
 * @Author: fenghouzhi
 * @Date: 2018/8/31
 */
@Slf4j
public class GetWeiXinAccessToken {

  public static String getAccessToken() {
    Map<String, Object> paramMap = new HashMap<>(3);
    paramMap.put("grant_type", CodeUtil.CLIENT_CREDENTIAL);
    paramMap.put("appid", CodeUtil.APP_ID);
    paramMap.put("secret", CodeUtil.APP_SECRET);
    String accessToken = null;
    try {
      accessToken = HttpRequestUtil.httpGet(CodeUtil.WEIXIN_TOKEN, paramMap);
      log.info("获取access_token info:    " + accessToken);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return accessToken;
  }

}
